<style>
.mod-group {
    margin: 0 auto;
	margin-top: 5px;
    width: 94%;
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #f2f2f2;
}
.fui-icon-group .fui-icon-col-sm {
    margin:10px 0;
}
.badge {
    left: 2rem;
    top: 0;
}
.label-success{background:#dcf4f4;color:#00b7a3;padding:0.3rem;border-radius:0.3rem}
.btn{border-radius: 100%;border: 0 solid #ebebeb;margin: 0.25rem;}
.btn-logo.active{border: 2px solid #3263fe;}
.btn-logo {
		padding:0px;
		height:2rem;
		width:2rem;
		border-radius: 100%;
		border: 2px solid #ebebeb;
}
.fui-icon-group .fui-icon-col-sm {padding: 0.5rem 0;}
.fui-icon-group .fui-icon-col-sm .text {
    font-size: 0.75rem;
}
</style>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='main'">
	<div ng-include="sys_html('common/_header')"></div>
	<div class='fui-content member-page' style="top:0;">
		<div class="jy-topbg" style="top:0;">
		<div class="bottombg" style="padding:0.5rem;padding-bottom:0">
			<div class="fui-cellone" style="padding-top:5.5rem;background:none;border-radius:0.5rem;align-items:stretch">
				<div class="fui-cellone-text">
					<div class="bold" style="width:100%;font-size:1rem" href="javascript:;" ng-click="pagedata.showbody=true"><span> {{pagedata.user.title||'本人'}} </span> <i class="icon icon-shuru"></i></div>
					<div class="gray" style="font-size:0.6rem;padding-top:0.5rem">
						性别 / 会员 / ID
					</div>
					<div class="bold" style="font-size:0.8rem">{{pagedata.user.sex==1?'男':'女'}}  <span style="padding-left:0.5rem">ID:{{pagedata.user.mid||'**'}}</span></div>
					<div class="" ng-if="pagedata.basic.no_vip !=1 && pagedata.user.isvip==1 && pagedata.user.vipstatus ==1" href="javascript:;" ng-click="access_json('jy_agentmcp/home/buyvip/')">
						VIP有效期:{{pagedata.user.viptime}} 
						<span class="btn btn-sm jy-btn2" style="line-height:2;color:#fff;border-radius:0.2rem">续费VIP</span>
					</div>
					<div class="" ng-if="pagedata.basic.no_vip !=1 && pagedata.user.isvip==1 && pagedata.user.vipstatus ==2" href="javascript:;" ng-click="access_json('jy_agentmcp/home/buyvip/')">
						VIP已过期 <span class="btn btn-sm jy-btn2" style="line-height:2;color:#fff;border-radius:0.2rem">续费VIP</span>
					</div>
					<div class="" ng-if="pagedata.basic.no_vip !=1 && pagedata.user.isvip!=1" href="javascript:;" ng-click="access_json('jy_agentmcp/home/buyvip/')">
						<span class="btn btn-sm jy-btn2" style="line-height:2;color:#fff;border-radius:0.2rem">购买VIP</span>
					</div>
					<img ng-if="pagedata.member && pagedata.member.sex==1" src="../addons/jy_agentmcp/resource/images/nan2.png" style="width: 6rem;position: absolute;bottom:0;right:0"/>
					<img ng-if="pagedata.member && pagedata.member.sex!=1" src="../addons/jy_agentmcp/resource/images/nv2.png" style="width: 6rem;position: absolute;bottom:0;right:0"/>
				</div>
			</div>
		</div>
		</div>
		<div style="padding:0.5rem">
		<div class="fui-cell-group fui-cell-click " style="border-radius:0.5rem;margin-top:0">
				<a class="fui-cell external" href="javascript:;" ng-click="access_json('core/member.xunibi//type=1')">
					<div class="fui-cell-text bold">积分记录</div>
					<div class="fui-cell-remark" style="font-size: 0.65rem;">查看</div>
				</a>
				<a class="fui-cell external" href="javascript:;" ng-click="access_json('jy_agentmcp/home/viplog/')">
					<div class="fui-cell-text bold">VIP购买记录</div>
					<div class="fui-cell-remark" style="font-size: 0.65rem;">查看</div>
				</a>
		</div>
		</div>
		<div ng-include="sys_html('common/_copyright',true)"></div>
	</div>
</div>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='buyvip'">
<div class="fui-content">
	<div ng-include="sys_html('common/_header')"></div>
	<div class="jy-topbg" style="top:0;">
		<div class="fui-picture">
				<a style="display: block; padding: {paddingtop}px {paddingleft}px;" data-nocache="true">
					<img ng-src="{{tomedia(pagedata.vipbg) || '../core/resource/images/nopic.jpg'}}">
				</a>
		</div>
		<div class="jy-content">
		<div class="fui-cell-group fui-cell-click radius" style="padding-bottom:0.3rem;">
			<div class="fui-cell">
				<div class="fui-cell-label" style='width:auto' >付费方式</div>
				<div class="fui-cell-text"> <span ng-click="pagedata.type(1);" ng-class="{'jylabel jylabel-red':1,'active':pagedata.post.paytype==1}" style="margin-right:10px">按月支付</span><span ng-click="pagedata.type(2);" ng-class="{'jylabel jylabel-red':1,'active':pagedata.post.paytype==2}" style="margin-right:10px">按季支付</span><span ng-click="pagedata.type(3);" ng-class="{'jylabel jylabel-red':1,'active':pagedata.post.paytype==3}">按年支付</span></div>
			</div>
			<div class="fui-cell">
				<div class="fui-cell-label" style='width:auto' >开通时长</div>
				<div class="fui-cell-mask noremark" style="margin-right:10px">
					 <div class="fui-number">
						<div class="minus" ng-click="pagedata.minus(pagedata.post.paytype)">-</div>
						<input class="num" type="tel" name="" value="{{pagedata.post.num}}" readonly="readonly"/>
						<div class="plus" ng-click="pagedata.plus(pagedata.post.paytype)">+</div>
					</div>
				</div>
				<div ng-if="pagedata.post.paytype==1" class="fui-cell-text">个月</div><div ng-if="pagedata.post.paytype==2"  class="fui-cell-text" >个季度</div><div ng-if="pagedata.post.paytype==3" class="fui-cell-text">年</div>
			</div>
			<div class="fui-cell">
				<div class="fui-cell-label" style='width:auto' >费用合计：</div>
				<div class="fui-cell-text bold" style="color:red"> ￥{{pagedata.fee || '0.00'}} <span class="delete">原价:￥{{pagedata.fee0}}</span></div>
			</div>
		</div>
		</div>
		<div class="weui_cells_checkbox" style="margin-top:2rem">
                <div class="fui-cell-label" style="text-align:center;margin:0 auto;padding:0.2rem">
                    <input type="checkbox" class="fui fui-checkbox fui-checkbox-danger verify-checkbox" style="line-height:0.6rem" ng-checked="pagedata.post.checked==true" ng-model="pagedata.post.checked">
					我已阅读并同意《<a onclick="$('#showsystemcontent').modal();" style="color:f60">会员协议</a>》
                </div>
        </div>
		<div class="fui-cellone" style="padding-top: 0;margin-top:1rem">
			<div wx:if="{{pagedata.post.status==1}}" class="fui-cellone-text" style="padding-right:0.5rem">
				<div class="radius c jy-btn1" ng-click="access_json('/home/')" style="border-radius:1rem;color:red;padding:0.7rem">
					关闭
				</div>
			</div>	
			<div class="fui-cellone-text">
				<div class="radius c jy-btn2" ng-click="pagedata.buyvip();" style="border-radius:1rem;color:#fff;padding:0.7rem">
					确定支付
				</div>
			</div>
		</div>
</div>
<div id="showsystemcontent" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:96%;left:2%;top:1.5%;">
<div class="modal-content" style="min-height:500px">
	<div aria-hidden="true" data-dismiss="modal" class="closebtn" style="right:10px;top:0"><i class="icon jinyunicon icon-wrong" style="color:#ccc;"></i></div>
	<div class="fui-article-page">
			<div class="fui-article-title" style="text-align:center">平台声明</div>
			<div class="fui-article-content" ng-bind-html="trust(pagedata.basic.systemcontent)"></div>
	</div>
</div>
</div>
</div>
<script type="text/javascript">
//购买
scope.pagedata.buyvip=function(){
	if(!scope.pagedata.post.checked){
		scope.message('请先阅读并勾选《会员协议》','error');
		return false;
	}
	scope.post_json('jy_agentmcp/home/buyvip/',{'num':scope.pagedata.post.num,'paytype':scope.pagedata.post.paytype},function(res){
		console.log('pay_id');console.log(res.payid);
		scope.tool.pay(res.payid,function(res){
				console.log('收到支付结果！');
				if(res.type=='success'){
					scope.message('支付成功！','','goback');
				}else{
					scope.message('支付失败！'+res.message,'','goback');
				}
		},'','','jy_agentmcp/home/');
	});
	return
}
//减少
scope.pagedata.minus=function(type){
	if(scope.pagedata.post.num <=1){
		return false;
	}
	scope.pagedata.post.num--;
	scope.pagedata.jisuan(type,scope.pagedata.post.num);
	return
}
//增加
scope.pagedata.plus=function(type){
	scope.pagedata.post.num++;
	scope.pagedata.jisuan(type,scope.pagedata.post.num);
	return
}
//选择付款类型
scope.pagedata.type=function(type){
	scope.pagedata.post.num=1
	scope.pagedata.post.paytype = type;
	scope.pagedata.jisuan(type,scope.pagedata.post.num);
	return
}
//计算
scope.pagedata.jisuan=function(type,num){
	if(type ==1){
		scope.pagedata.fee = getprice(scope.pagedata.basic.mfee * num)
		if(scope.pagedata.basic.mfee0){
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.mfee0 * num)
		}else{
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.mfee * 1.5 * num)
		}
	}else if(type ==2){
		scope.pagedata.fee = getprice(scope.pagedata.basic.jfee * num)
		if(scope.pagedata.basic.jfee0){
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.jfee0 * num)
		}else{
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.jfee * 1.5 * num)
		}
		
	}else if(type ==3){
		scope.pagedata.fee = getprice(scope.pagedata.basic.yfee * num)
		if(scope.pagedata.basic.yfee0){
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.yfee0 * num)
		}else{
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.yfee * 1.5 * num)
		}
	}
	scope.$evalAsync();
}
function getprice(num)
{
	//var num = parseFloat(num);
	num = num.toFixed(2);
	//console.log(num);
	return num
	
}
</script>
</div>
</div>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='viplog'">
<div ng-include="sys_html('common/_header')"></div>
<div class="fui-content" style="margin-bottom:4.8rem">
	<div class="jy-topbg" style="top:0;">
	<div class="jy-content">
		<div class="fui-cell-group fui-comment-group" ng-repeat="item in pagedata.list">	
				<div class="fui-cell">
					<div class="fui-cell-text">
						<div class="text bold" style="font-size:0.65rem;color:#5c5c5c">{{item.fee}}元</div>
						<div class="gray" style="font-size:0.55rem">{{item.createtime}}</div>
					</div>
					<div class="fui-cell-remark noremark">
						<span class="red">{{item.ispay}}</span>
					</div>
				</div>
				<div ng-if="!pagedata.loading && (!pagedata.list || pagedata.list.length<1)" class='content-empty' style="margin-top:0">
					<i class='icon icon-cry' style="font-size:1.5rem"></i><br/>暂时没有任何信息
				</div>
		</div>
		<div ng-show="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
		<div ng-include="sys_html('common/_copyright',true)"></div>
	</div>
</div>
<script>
	scope.tool.get_list('jy_agentmcp/home/viplog/',true);
	scope.pagedata.scroll_bottom=function(){
		scope.tool.get_list('jy_agentmcp/home/viplog/');
	}
</script>
</div>
</div>
<div ng-include="sys_html('common/_chekbody')"></div>
<div ng-include="sys_html('common/_footer')"></div>